﻿<%@ Control language="C#" Inherits="News.SearchNews" CodeFile="SearchNews.ascx.cs" AutoEventWireup="true"%>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<center>
    &nbsp; &nbsp;<asp:Label ID="lblTopMessage" runat="server" CssClass="titletext3"></asp:Label>
    <asp:Panel ID="pnlResult" runat="server" Visible="False" Width="100%">
        <table border="0" width="100%">
            <tr>
                <td colspan="3">
                    <asp:GridView ID="gvResultSearch" runat="server" AllowPaging="True" AllowSorting="True"
                        AutoGenerateColumns="False" DataSourceID="dsResultSearch" OnDataBound="gvResultSearch_DataBound"
                        OnPageIndexChanging="gvResultSearch_PageIndexChanging" OnSorting="gvResultSearch_Sorting"
                        Width="100%" CssClass="table">
                        <Columns>
                            <asp:TemplateField>
                                <ItemStyle HorizontalAlign="Center" Width="20px" />
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbxCheck" runat="server" />
                                    <asp:Label ID="lblNewsId" runat="server" Text='<%# Eval("newsId") %>' Visible="False"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Chủ đề" SortExpression="subject">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("subject") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# getLink(DataBinder.Eval(Container, "DataItem.newsId").ToString()) %>'><%# DataBinder.Eval(Container, "DataItem.subject")%></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="description1" HeaderText="Trạng th&#225;i" SortExpression="description1">
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                                <HeaderStyle HorizontalAlign="Center" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Ng&#224;y đăng" SortExpression="openDate">
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# DateString((DateTime)Eval("openDate")) %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="account" HeaderText="T&#224;i khoản" SortExpression="account" >
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                            </asp:BoundField>
                        </Columns>
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle HorizontalAlign="Right" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:CheckBox ID="cbxCheckAll" runat="server" AutoPostBack="True" OnCheckedChanged="cbxCheckAll_CheckedChanged" Text="Chọn tất cả " /></td>
                <td colspan="1" style="text-align: right">
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Label ID="lblSetStatus" runat="server"   Text="Trạng thái" CssClass="titletext3" Width="80px"></asp:Label><asp:DropDownList
                        ID="ddlSetStatus" runat="server" AppendDataBoundItems="True">
                    </asp:DropDownList><asp:Button ID="btnAgree" runat="server"  
                        OnClick="btnAgree_Click" Text="Thiết lập " CssClass="btn" Width="80px" />
                    </td>
                <td colspan="1" style="text-align: right">
                    <asp:Button ID="btnDelete" runat="server"  
                        OnClick="btnDelete_Click" Text="Xóa chọn" CssClass="btn" Width="80px" OnClientClick="&quot;return confirm('Xóa tin đã chọn ?')&quot;" />
                    &nbsp;&nbsp; &nbsp;<asp:Button ID="btnExport" runat="server" CssClass="btn" OnClick="btnExport_Click"
                        Text="Excel" Visible="False" />
                    </td>
            </tr>
            <tr>
                <td colspan="3" style="height: 37px"><hr class="table" />
                </td>
            </tr>
        </table>
        <asp:SqlDataSource ID="dsResultSearch" runat="server"></asp:SqlDataSource>
    </asp:Panel>
    
    <asp:Panel ID="pnlSearchNews" runat="server" Width="100%"><TABLE class="table" width="100%" border=0><TBODY>
        <tr>
            <td>
            </td>
            <td>
            </td>
            <td>
    <asp:LinkButton ID="btnNoNewItem" runat="server" OnClick="btnNoNewItem_Click" Width="80px"></asp:LinkButton><asp:LinkButton ID="btnNoPendingItem" runat="server" OnClick="btnNoPendingItem_Click" Width="120px"></asp:LinkButton><asp:LinkButton ID="btnNoExpireItem" runat="server" OnClick="btnNoExpireItem_Click" Width="120px"></asp:LinkButton></td>
        </tr>
        <TR><TD></TD><TD><asp:Label id="Label5" CssClass="titletext3" runat="server" Text="Chủ đề :"></asp:Label></TD><TD><asp:TextBox id="tbxSubject" runat="server" Width="354px" MaxLength="15"></asp:TextBox> </TD></TR><TR><TD style="WIDTH: 128px"></TD><TD style="WIDTH: 128px"><asp:Label id="lb" CssClass="titletext3" runat="server" Text="Nội dung :"></asp:Label></TD><TD><asp:TextBox id="tbxContent" runat="server" Width="354px" MaxLength="15"></asp:TextBox></TD></TR>
        <tr>
            <td style="height: 24px">
            </td>
            <td style="height: 24px">
            </td>
            <td>
                <asp:CheckBox ID="cbxFindEachWord" runat="server" Text="Tìm từng từ" /></td>
        </tr>
        <TR><TD style="HEIGHT: 24px"></TD><TD style="HEIGHT: 24px"><asp:Label id="Label3" CssClass="titletext3" runat="server" Text="Trạng thái :"></asp:Label></TD><TD><asp:DropDownList id="ddlStatus" runat="server" AppendDataBoundItems="True">
                    </asp:DropDownList></TD></TR><TR><TD></TD><TD><asp:Label id="Label4" CssClass="titletext3" runat="server" Text="Loại :"></asp:Label></TD><TD><asp:DropDownList id="ddlNewsType" runat="server" AppendDataBoundItems="True">
                </asp:DropDownList></TD></TR><TR><TD></TD><TD><asp:Label id="Label2" CssClass="titletext3" runat="server" Text="Tài khoản :"></asp:Label></TD><TD><asp:TextBox id="tbxAccount" runat="server" Width="150px" MaxLength="15"></asp:TextBox></TD></TR><TR><TD></TD><TD><asp:Label id="Label6" CssClass="titletext3" runat="server" Text="Thời gian tạo :"></asp:Label></TD><TD><asp:TextBox id="tbxFromDate" runat="server" Width="80px"></asp:TextBox><asp:HyperLink id="hlkFromDate" runat="server" ImageUrl="~/images/calendar.png"></asp:HyperLink> ~ &nbsp;<asp:TextBox id="tbxToDate" runat="server" Width="80px"></asp:TextBox><asp:HyperLink id="hlkToDate" runat="server" ImageUrl="~/images/calendar.png"></asp:HyperLink></TD></TR><TR><TD></TD><TD><asp:Label id="Label8" CssClass="titletext3" runat="server" Text="Thời gian đăng :"></asp:Label></TD><TD><asp:TextBox id="tbxOpenFrDate" runat="server" Width="80px"></asp:TextBox><asp:HyperLink id="hlktbxOpenFrDate" runat="server" ImageUrl="~/images/calendar.png"></asp:HyperLink> ~&nbsp; <asp:TextBox id="tbxOpenToDate" runat="server" Width="80px"></asp:TextBox><asp:HyperLink id="hlkOpenToDate" runat="server" ImageUrl="~/images/calendar.png"></asp:HyperLink></TD></TR>
        <tr>
            <td>
            </td>
            <td>
            </td>
            <td>
                <asp:CheckBox ID="chkExpire" runat="server" Text="Hết hạn" />
            </td>
        </tr>
        <TR><TD></TD><TD></TD><TD><asp:Button id="btnList" onclick="btnList_Click" CssClass="btn" runat="server" Width="90px" Text="Tìm kiếm" ValidationGroup="a"></asp:Button><asp:Button id="btnclear" onclick="btnclear_Click" CssClass="btn" runat="server" Width="90px" Text="Làm lại"></asp:Button><asp:Button id="btnAddNew" onclick="btnAddNew_Click" CssClass="btn" runat="server" Width="90px" Text="Thêm mới"></asp:Button></TD></TR></TBODY></TABLE></asp:Panel>
</center>
                    <asp:Label ID="lblMessage" runat="server" CssClass="titletext3"></asp:Label><asp:Label ID="lblDebugMessage" runat="server" CssClass="titletext3"></asp:Label>
